@use '../variables';

@mixin polyfill-row-gap($row-gap) {
  @if variables.$enable-gap == true {
    row-gap: #{$row-gap};
  } @else {
    & {
      margin-top: -#{$row-gap};
    }

    & > * {
      margin-top: #{$row-gap};
    }
  }
}

@mixin polyfill-column-gap($column-gap) {
  @if variables.$enable-gap == true {
    column-gap: #{$column-gap};
  } @else {
    & > *:not(:last-child) {
      margin-right: #{$column-gap};
    }
  }
}

@mixin polyfill-gap($row-gap, $column-gap) {
  @if variables.$enable-gap == true {
    gap: #{$row-gap} #{$column-gap};
  } @else {
    @include polyfill-row-gap($row-gap);
    @include polyfill-column-gap($row-gap);
  }
}
